\documentclass{article}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsfonts}
\usepackage{graphicx} 
\usepackage[left=1cm,right=1cm,top=1cm,bottom=2cm]{geometry}
\title{NumPDE Homework 4}
\author{Jiang Zhou 3220101339 }
\date{2025/4/14}

\begin{document}
\maketitle
\section{Exercise 11.5}
For the Improved Euler method, we have:
\begin{equation*}
    \begin{cases}
        \mathbf{y_1} = \mathbf{f}(\mathbf{U}^n, t_n) \\
        \mathbf{y_2} = \mathbf{f}(\mathbf{U}^n +  k\mathbf{y_1}, t_n + k) \\
        \mathbf{U}^{n+1} = \mathbf{U}^n + \frac{k}{2} (\mathbf{y_1} + \mathbf{y_2})
    \end{cases}
\end{equation*}
which yields \(\Phi(u(t_n), t_n; k) = \frac{1}{2} (\mathbf{y_1} + \mathbf{y_2}) = \frac{1}{2} [\mathbf{f}(u(t_n), t_n) + \mathbf{f}(u(t_n) + k\mathbf{f}(u(t_n), t_n), t_n + k)]\).\\
For the modified Euler method, we have:
\begin{equation*}
    \begin{cases}
        \mathbf{y_1} = \mathbf{f}(\mathbf{U}^n, t_n) \\
        \mathbf{y_2} = \mathbf{f}(\mathbf{U}^n + \frac{k}{2}\mathbf{y_1}, t_n + \frac{k}{2}) \\
        \mathbf{U}^{n+1} = \mathbf{U}^n + k\mathbf{y_2}
    \end{cases}
\end{equation*}
which yields \(\Phi(u(t_n), t_n; k) = \mathbf{y_2} = \mathbf{f}(u(t_n) + \frac{k}{2}\mathbf{f}(u(t_n), t_n), t_n + \frac{k}{2})\).\\
In Figure 11.1, the length of a short thick line segment represents:
\begin{align*}
    \text{Length} = |u(t_{n+1}) - U^{n+1}| = |u(t_{n+1}) - u(t_n) - k \Phi(u(t_n), t_n; k)| =  \mathcal{L} \mathbf{u}(t_n)
\end{align*}
So, the length of a short thick line segment in Figure 11.1 represent the one-step error in Definition 11.8.
\section{Exercise 11.7}
As shown in Figure \ref{fig:E11_7}, we choose 
\begin{equation*}
    \begin{cases}
        f(u,t) = -5u;\\
        u = e^{-5t}.
    \end{cases}
\end{equation*}
\begin{figure}[!h]
    \centering
    \includegraphics[width=0.75\textwidth]{figure/E11_7.png}
    \caption{Geometric interpretation of TRBDF2}
    \label{fig:E11_7} 
\end{figure}

\section{Exercise 11.11}
To derive the \( k^3 \) term in the one-step error \( \mathcal{L}u(t_n) \) of the explicit midpoint method and verify its second-order accuracy, we proceed with recursive Taylor expansions. The explicit midpoint method is given by:
\[
U^{n+1} = U^n + k f\left(U^n + \frac{k}{2} f(U^n, t_n), t_n + \frac{k}{2}\right).
\]

The exact solution at \( t_{n+1} = t_n + k \) is expanded as:
\[
u(t_{n+1}) = u(t_n) + k u'(t_n) + \frac{k^2}{2} u''(t_n) + \frac{k^3}{6} u'''(t_n) + \mathcal{O}(k^4).
\]
Using \( u'(t) = f(u(t), t) \), we compute higher derivatives:
\[
u''(t) = f_u u' + f_t = f_u f + f_t,
\]
\[
u'''(t) = f_u^2f + f_{uu} f^2 + f_uf_t + 2f_{tu}f + f_{tt}.
\]
Let \( y_1 = f(U^n, t_n) \) and \( y_2 = f\left(U^n + \frac{k}{2} y_1, t_n + \frac{k}{2}\right) \).  
Expand \( y_2 \) using Taylor series around \( (U^n, t_n) \):
\[
y_2 = f + \frac{k}{2} f_u y_1 + \frac{k}{2} f_t + \frac{k^2}{8} f_{uu} y_1^2 + \frac{k^2}{4} f_{tu} y_1 + \frac{k^2}{8} f_{tt} + \mathcal{O}(k^3),
\]
where \( f \) and its derivatives are evaluated at \( (U^n, t_n) \). Substitute \( y_1 = f \):
\[
y_2 = f + \frac{k}{2} (f_u f + f_t) + \frac{k^2}{8} \left( f_{uu} f^2 + 2 f_{tu} f + f_{tt} \right) + \mathcal{O}(k^3).
\]
Now, the numerical solution becomes:
\[
U^{n+1} = U^n + k y_2 = U^n + k f + \frac{k^2}{2} (f_u f + f_t) + \frac{k^3}{8} \left( f_{uu} f^2 + 2 f_{tu} f + f_{tt} \right) + \mathcal{O}(k^4).
\]
Subtract the numerical solution from the exact solution:
\[
\mathcal{L}u(t_n) = u(t_{n+1}) - U^{n+1}.
\]
Substitute the expansions:
\begin{align*}
    \mathcal{L}u(t_n) = &\left[ u(t_n) + k f + \frac{k^2}{2} (f_u f + f_t) + \frac{k^3}{6} u''' \right] \\
    - &\left[ U^n + k f + \frac{k^2}{2} (f_u f + f_t) + \frac{k^3}{8} (f_{uu} f^2 + 2 f_{tu} f + f_{tt}) \right] + \mathcal{O}(k^4)
\end{align*}

Assuming \( U^n = u(t_n) \), the lower-order terms cancel, leaving:
\[
\mathcal{L}u(t_n) = \frac{k^3}{6} u'''(t_n) - \frac{k^3}{8} \left( f_{uu} f^2 + 2 f_{tu} f + f_{tt} \right) + \mathcal{O}(k^4).
\]
Simplify using \( u'''(t_n) = f_u^2f + f_{uu} f^2 + f_uf_t + 2f_{tu}f + f_{tt}. \):
\[
\mathcal{L}u(t_n) = \frac{k^3}{24} \left( f_{uu} f^2 + 2 f_{tu} f + f_{tt} \right) + \mathcal{O}(k^4).
\]

The leading term is \( \mathcal{L}u(t_n) = \Theta(k^3) \), confirming that the explicit midpoint method is **second-order accurate** (since the error scales as \( k^3 \) for small \( k \)). 

The one-step error of the explicit midpoint method is:
\[
\mathcal{L}u(t_n) = \frac{k^3}{6}(f_u^2f + f_uf_t)+\frac{k^3}{24} \left( f_{uu} f^2 + 2 f_{tu} f + f_{tt} \right) + \mathcal{O}(k^4),
\]
which demonstrates \( \mathcal{L}u(t_n) = \Theta(k^3) \) and second-order accuracy.

\section{Exercise 11.20}
By (11.5), we can get:
\begin{align*}
    U^* = U^{n} + \frac{k}{4}  (f (U^n, t_n) + f (U^*, t_n + \frac{k}{2}))
\end{align*}
For the test problem \(u'(t) = \lambda u\), we can simplify the equation as follows:
\begin{align*}
    &U^* = U^{n} + \frac{k}{4}  (\lambda U^n + \lambda U^*) = \left(1 + \frac{k\lambda}{4}\right) U^{n} + \frac{k\lambda}{4} U^* \\
    \Rightarrow &U^* = \frac{1 + \frac{k\lambda}{4}}{1 - \frac{k\lambda}{4}}U^n
\end{align*}
As for the second step, we can get:
\begin{align*}
    U^{n+1} = \frac{1}{3} (4U^* - U^n + kf (U^{n+1}, t_{n+1})) = \frac{1}{3} (4U^* - U^n + k\lambda U^{n+1}) \\
    \Rightarrow U^{n+1} = \frac{4U^* - U^n}{3 - k\lambda} = \frac{4}{3 - k\lambda}U^* - \frac{1}{3 - k\lambda}U^n = (\frac{4}{3 - k\lambda}*\frac{1 + \frac{k\lambda}{4}}{1 - \frac{k\lambda}{4}}- \frac{1}{3 - \frac{k\lambda}{3}})U^n
\end{align*}
Through the above equation, we can get the final result by applying \(z := k\lambda\):
\begin{align*}
    U^{n+1} = \frac{12+5k\lambda}{12-7k\lambda+(k\lambda)^2}U^n
    \Rightarrow R(z) = \frac{12+5z}{12-7z+z^2}
\end{align*}
Expand \(R(z) - e^z\) using Taylor expansion:
\begin{align*}
    R(z) - e^z &= \frac{12+5z}{12-7z+z^2} - \left(1 + z + \frac{z^2}{2} +\frac{z^3}{6} + \frac{z^4}{24} +\cdots\right) \\
    &= \frac{(12+5z) - (12-7z+z^2)(1 + z + \frac{z^2}{2}+\frac{z^3}{6}+ \frac{z^4}{24} +\cdots)}{12-7z+z^2} \\
    &= \frac{O(z^5)}{12-7z+z^2} = O(z^3).
\end{align*}

\section{Exercise 11.25}
As shown in Figure Figure \ref{fig:E11_25_trap} and \ref{fig:E11_25_be}:
\begin{figure}[h!]
    \centering
    \begin{minipage}{0.45\textwidth}
        \centering
        \includegraphics[width=\textwidth]{figure/E11_25_trap.png}
        \caption{Second-order trapezoidal method}
        \label{fig:E11_25_trap}
    \end{minipage}
    \hfill
    \begin{minipage}{0.45\textwidth}
        \centering
        \includegraphics[width=\textwidth]{figure/E11_25_be.png}
        \caption{Backward Euler method.}
        \label{fig:E11_25_be}
    \end{minipage}
\end{figure}

\subsection{Backward Euler is L-stable}  
It aggressively damps out fast, unstable components (like \( e^{-10^6 t} \)) in stiff equations, even with large step sizes.  \\
For problems where the true solution decays rapidly, backward Euler "kills" these terms quickly, avoiding oscillations.  

\subsection{Trapezoidal is only A-stable}
While stable, it preserves oscillations in stiff transients because its stability function \( R(z) \to -1 \) as \( z \to -\infty \).  \\
This leads to "ringing" artifacts when solving stiff ODEs.  


\section{Exercise 11.28}
\subsection{Modified Euler method}
\begin{equation*}
        \begin{cases}
            \mathbf{y}_1 = \mathbf{f}(\mathbf{U}^n, t_n) \\
            \mathbf{y}_2 = \mathbf{f}(\mathbf{U}^n + \frac{k}{2}\mathbf{y}_1, t_n + \frac{k}{2}) \\
            \mathbf{U}^{n+1} = \mathbf{U}^n + k\mathbf{y}_2
        \end{cases}
\end{equation*}
From the above equation, we can get :\(a_{1,1} = a_{1,2} = a_{2,2} = 0, a_{2,1} = \frac{1}{2}, c_1 = 0, c_2 = \frac{1}{2}, b_1 = 0, b_2 = 1\)
\[
\begin{array}{c|cc}
0 & 0 & 0 \\
\frac{1}{2} & \frac{1}{2} & 0 \\
\hline
  & 0 & 1
\end{array}
\]

\subsection{Improved Euler method}
\begin{equation*}
        \begin{cases}
            \mathbf{y}_1 = \mathbf{f}(\mathbf{U}^n, t_n) \\
            \mathbf{y}_2 = \mathbf{f}(\mathbf{U}^n + k\mathbf{y}_1, t_n + k) \\
            \mathbf{U}^{n+1} = \mathbf{U}^n + \frac{k}{2}(\mathbf{y}_1 + \mathbf{y}_2)
        \end{cases}
\end{equation*}
From the above equation, we can get :\(a_{1,1} = a_{1,2} = a_{2,2} = 0, a_{2,1} = 1, c_1 = 0, c_2 = 1, b_1 = \frac{1}{2}, b_2 = \frac{1}{2}\)
\[
\begin{array}{c|cc}
0 & 0 & 0 \\
1 & 1 & 0 \\
\hline
  & \frac{1}{2} & \frac{1}{2}
\end{array}
\]

\subsection{Heun's third-order method}
\begin{equation*}
    \begin{cases}
    \mathbf{y}_1 = \mathbf{f}(\mathbf{U}^n, t_n) \\
    \mathbf{y}_2 = \mathbf{f}(\mathbf{U}^n + \frac{k}{3}\mathbf{y}_1, t_n + \frac{k}{3}) \\
    \mathbf{y}_3 = \mathbf{f}(\mathbf{U}^n + \frac{2k}{3}\mathbf{y}_2, t_n + \frac{2k}{3}) \\
    \mathbf{U}^{n+1} = \mathbf{U}^n + \frac{k}{4}(\mathbf{y}_1 + 3\mathbf{y}_3)
    \end{cases}
\end{equation*}
From the above equation, we can get :\( a_{2,1} = \frac{1}{3}, a_{3,2} = \frac{2}{3}, c_1 = 0, c_2 = \frac{1}{3}, c_3 = \frac{2}{3}, b_1 = \frac{1}{4}, b_3 = \frac{3}{4}\)
\[
\begin{array}{c|ccc}
0 & 0 & 0 & 0 \\
\frac{1}{3} & \frac{1}{3} & 0 & 0 \\
\frac{2}{3} & 0 & \frac{2}{3} & 0 \\
\hline
  & \frac{1}{4} & 0 & \frac{3}{4}
\end{array}
\]


\section{Exercise 11.29}
In order to derive the formulas(11.22), define:
\begin{equation}
    \mathbf{\xi}_i = \mathbf{U}^n + k\sum_{j=1}^{s}a_{i,j}\mathbf{y}_j  
    \label{eq:def_xi}  
\end{equation}
Applying \ref{eq:def_xi} to (11.20), we can get:
\begin{align*}
    \mathbf{y}_i = \mathbf{f} (\mathbf{U}^n + k\sum_{j=1}^{s}b_{i,j}\mathbf{y}_j, t_n + c_i k) \\
    \Rightarrow \mathbf{y}_i = \mathbf{f} (\mathbf{\xi}_i, t_n + c_i k) 
\end{align*}
As a result, we can get the following equation:
\begin{align*}
    \mathbf{\xi}_i = \mathbf{U}^n + k\sum_{j=1}^{s}a_{i,j}\mathbf{f} (\mathbf{\xi}_j, t_n + c_j k) \\
    \mathbf{U}^{n+1} = \mathbf{U}^n + k\sum_{j=1}^{s}b_{i,j}\mathbf{f} (\mathbf{\xi}_j, t_n + c_j k).
\end{align*}

\end{document}
